(modify_event_symbol): If a name_table elt is null,
authorRichard M. Stallman <rms@gnu.org>
Mon, 24 May 1993 22:58:54 +0000 (22:58 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 24 May 1993 22:58:54 +0000 (22:58 +0000)
generate a name to use.  Don't crash.

src/keyboard.c

index 327713942fb29b25a4bbe004477fba7fead79de7..371f4c3089ef59cc5fd9323bc6801b84f4373de8 100644 (file)
@@ -2739,7 +2739,14 @@ modify_event_symbol (symbol_num, modifiers, symbol_kind, name_table,
   if (NILP (*slot))
     {
       /* No; let's create it.  */
-      *slot = intern (name_table[symbol_num]);
+      if (name_table[symbol_num])
+       *slot = intern (name_table[symbol_num]);
+      else
+       {
+         char buf[20];
+         sprintf (buf, "key-%d", symbol_num);
+         *slot = intern (buf);
+       }
 
       /* Fill in the cache entries for this symbol; this also  
         builds the Qevent_symbol_elements property, which the user